import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import('../views/layout.vue'),
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('../views/Home/index.vue')
      },
      {
        path: '/topic',
        name: 'topic',
        component: () => import('../views/topic.vue')
      },
      {
        path: '/search',
        name: 'search',
        component: () => import('../views/search.vue')
      },
      {
        path: '/mine',
        name: 'mine',
        component: () => import('../views/mine.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes,
  linkActiveClass: 'active'
})

export default router
